package com.wyt.controller.empcollor;

import com.wyt.dao.TypeDeptMapper;
import com.wyt.dao.TypeRoleMapper;
import com.wyt.entity.TypeDept;
import com.wyt.entity.TypeRole;
import com.wyt.until.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: xiangmu01
 * @description: 部门以及职位下拉框
 * @author: 王一同
 * @create: 2021-11-24 10:46
 **/

@RestController
public class TypeController {
    @Autowired
    private TypeDeptMapper tdMapper;

    @Autowired
    private TypeRoleMapper trMapper;

    @RequestMapping("getAllType")
    public CommonResult getAllType(){
        List<TypeDept> allType = tdMapper.getAllType();
        CommonResult commonResult = new CommonResult(200,"",allType);
        return commonResult;
    }

    @RequestMapping("getAllRole")
    public CommonResult getAllRole(){
        List<TypeRole> AllRole = trMapper.getAllRole();
        CommonResult commonResult = new CommonResult(200,"",AllRole);
        return commonResult;
    }

}
